<include file="Public:header" />
<!-- main content start-->
<div class="main-content" >

<!-- header section start-->
<div class="header-section">

    <!--toggle button start-->
    <a class="toggle-btn"><i class="fa fa-bars"></i></a>
    <!--toggle button end-->



    <!--notification menu start -->
    <div class="menu-right">
        <ul class="notification-menu" style="margin-top: 15px;">
            <li>
                <span class="span" style="margin-top: 100px;"><!-- data-toggle="dropdown"-->
                    账户余额(元)<span style="color: red; font-size: 16px; font-weight: 800 ">{$info.money}</span>
                </span>
            </li>
        </ul>
    </div>
    <!--notification menu end -->

</div>
<!-- header section end-->
<!-- page heading start-->
<div class="page-heading">
    <h3>
        管理员管理
    </h3>
    <ul class="breadcrumb">
        <li>
            <a href="#">首页</a>
        </li>
        <li> 管理员管理 </li>
        <li class="active"> 修改密码 </li>
    </ul>
</div>
<!-- page heading end-->
<!--body wrapper start-->
<div class="wrapper">
    <section class="panel">
        <header class="panel-heading">
            添加员工
        </header>
        <div class="panel-body">
            <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" >
                <div class="form-group">
                    <label class="col-md-2 col-sm-2 control-label">旧密码</label>
                    <div class="col-md-6 col-sm-6">
                        <input type="password" name="pwd" id="pwd" class="form-control" placeholder="旧密码">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 col-sm-2 control-label">新密码</label>
                    <div class="col-md-6 col-sm-6">
                        <input type="password" name="newpwd" id="newpwd" class="form-control" placeholder="新密码">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 col-sm-2 control-label">确认新密码</label>
                    <div class="col-md-6 col-sm-6">
                        <input type="password" name="newpwdYes" id="newpwdYes" class="form-control" placeholder="确认新密码">
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-lg-offset-2 col-md-6 col-sm-6">
                        <button type="submit" class="btn btn-primary" onclick="return checkout()">确认修改</button>
                        <button type="button" class="btn btn-primary" onclick="history.go(-1)">返回</button>
                    </div>
                </div>

            </form>
        </div>
    </section>


</div>
<!--body wrapper end-->
<!-- main content end-->
    <script>
        function checkout(){
            if($("#pwd").val()==""){
                toast("旧密码不得为空",false);
                return false;
            }
            if($("#newpwd").val()==""){
                toast("新密码不得为空",false);
                return false;
            }
            if($("#newpwdYes").val()==""){
                toast("确认密码不得为空",false);
                return false;
            }
            if($("#newpwdYes").val()!=$("#newpwd").val()){
                toast("新密码和确认密码不一致",false);
                return false;
            }
            var url="{:U('Shopadmin/Login/changePwd')}";
            var pwd=$("#pwd").val();
            var newpwd=$("#newpwd").val();
            $.post(url,{pwd:pwd,newpwd:newpwd},function(res){
                if(res.success){
                    toast(res.msg,true);
                    window.location.href="{:U('Shopadmin/login/index')}";
                }else{
                    toast(res.msg,false);

                }
            });
            return false;
        }
    </script>
<include file="Public:footer" />